package com.xtm.exercise.base.A04string;

import org.junit.Test;

public class StringBuilderDemo {

    @Test
    public void test01(){
        //空参数构造方法
        StringBuilder bu1 = new StringBuilder();

        //String转换为StringBuilder   带字符串的构造方法
        String str = "hello";
        StringBuilder bu = new StringBuilder(str);
        //往StringBuilder中添加数据
        bu.append("world").append(1).append(true).append('中');

        //StringBuilder转换为String
        String s = bu.toString();

    }

}
